package com.henu.acmrating.dao;

import com.henu.acmrating.pojo.Blog;
import com.henu.acmrating.pojo.BlogWithUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BlogMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Blog record);

    int insertOrUpdate(Blog record);

    int insertOrUpdateSelective(Blog record);

    int insertSelective(Blog record);

    Blog selectByPrimaryKey(Integer id);

    List<Blog> selectByUserId(@Param("userId") Integer userId);

    List<Blog> selectByUserIdAndIsPublic(@Param("userId") Integer userId);

    int updateByPrimaryKeySelective(Blog record);

    int updateByPrimaryKey(Blog record);

    int updateBatch(List<Blog> list);

    int updateLikeById(@Param("updatedLike") Integer updatedLike, @Param("id") Integer id);

    int batchInsert(@Param("list") List<Blog> list);

    List<BlogWithUser> blogWithUser();

    List<BlogWithUser> blogWithUserByUserId(@Param("userId") Integer userId);

    BlogWithUser blogWithUserOne(@Param("userId") Integer userId, @Param("id") Integer id);
}